using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using DailyReport.Core.Bussines;
using DailyReport.Core.Bussines.IManagers;
using DailyReport.Core.Data.Dao;
using DailyReport.Core.Data.Dao.DaoFactory;
using DailyReport.Core.Data.Model;
using DailyReport.Core.Util;
using DailyReport.NHibernateDao.Data.Dao;
using log4net;
using NHibernate;

public partial class Pages_Task_UpDateTask : System.Web.UI.Page
{
    private TaskManager taskManager = new TaskManager();    
    static ILog log = LogManager.GetLogger("DailyPage");
    int id = 1;//(int)Session["TaskId"];

    protected void Page_Load(object sender, EventArgs e)
    {
        ISession session = ConnectionManager.Instance.Session;
        ddlUser.Items.Add("");
        UserDao userDao = new UserDao();
        userDao.Session = session;
        foreach (User user in userDao.GetAll())
        {
            ListItem item = new ListItem(user.LastName + "; " + user.FirstName, user.ID.ToString());
            ddlUser.Items.Add(item);
        }

        Task taskLoad = taskManager.loadTask(id);        
        txttitle.Text = taskLoad.Title;
        User aux = taskLoad.User;
        string valueManager = aux.ID.ToString();
        ddlUser.SelectedValue = valueManager;
        txtdexcribe.Text = taskLoad.Description;

    }
}
